import '@fortawesome/fontawesome-free/css/all.css'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import myaxios from '../src/api'
import service from '../src/api/request'
import qs from 'qs'
import Footer from '../src/components/Footer.vue'
import Header from '../src/components/Header.vue'

import {
  getCurDate,
  setSessionStorage,
  getSessionStorage,
  removeSessionStorage,
  setLocalStorage,
  getLocalStorage,
  removeLocalStorage
} from './common.js'

Vue.use(Element)

Vue.prototype.$axios = service
Vue.prototype.$qs = qs
Vue.prototype.$getCurDate = getCurDate
Vue.prototype.$setSessionStorage = setSessionStorage
Vue.prototype.$getSessionStorage = getSessionStorage
Vue.prototype.$removeSessionStorage = removeSessionStorage
Vue.prototype.$setLocalStorage = setLocalStorage
Vue.prototype.$getLocalStorage = getLocalStorage
Vue.prototype.$removeLocalStorage = removeLocalStorage

Vue.component('Footer', Footer)
Vue.component('Header', Header)

Vue.config.productionTip = false

require('./mock.js')

// ✅ 正确的 Vue2 挂载方式
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')